<%= form_for(@article) do |f| %>
<% if @article.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@article.errors.count, "error") %> prohibited this article from being saved:</h2>
      <ul>
        <% @article.errors.full_messages.each do |msg| %>
            <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
<% end %>

<div class="block">
  <div class="h">
    <span class="icon-sprite icon-list"></span>
    <h3>新增文章</h3>
    <div class="bar">
      <%= link_to '<span>返回</span>'.html_safe, articles_path,:class => 'btn-lit' %>
    </div>
  </div>
  <div class="tl corner"></div>
  <div class="tr corner"></div>
  <div class="bl corner"></div>
  <div class="br corner"></div>
  <div class="cnt-wp">
    <div class="cnt form">
      <form method="post" enctype="multipart/form-data" action="">
        <table class="data-form" cellspacing="0" cellpadding="0">
          <tbody>
          <tr>
            <th scope="row"><%= f.label :title %></th>
            <td><%= f.text_field :title, :class => 'input-normal' %></td>
          </tr>
          <tr>
            <th scope="row"><%= f.label :body %></th>
            <td><%= f.kindeditor :body, :editor_id => 'my_editor', :width => '95%' %></td>
          </tr>
          <tr>
            <th scope="row"><%= f.label :author %></th>
            <td><%= f.text_field :author, :class => 'input-normal' %></td>
          </tr>
          <tr>
            <th scope="row">&nbsp;</th>
            <td>
              <%= f.submit %>
            </td>
          </tr>
          </tbody>
        </table>
      </form>
    </div>
  </div>
</div>
<% end %>